package com.itheima.test04;

public class Demo6 {
    public static void main(String[] args) {
        // 创建对象，并初始化数据
        Person p1 = new Person("张三",23);
        Person p2 = new Person("李四",24);
        // 输出对象中数据
        System.out.println(p1.toString());
        System.out.println(p2);
    }
}

class Person {
    private String name;
    private int age;
    /*
        请补充代码！
    */
    public void print(){
        System.out.println(getName()+"..."+getAge());
    }

    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        print();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}